
package actions;
import java.util.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import forms.DegreeFormInsert;

import model.CountryModel;
import model.UniversityModel;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import forms.ApplicantFormInsert;
import db.DbException;

public class addressAction extends Action{
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws DbException {
		
		ArrayList<DegreeFormInsert> degrees = new ArrayList<DegreeFormInsert>();
        request.getSession().setAttribute("degrees", degrees);
        
		ApplicantFormInsert iform =(ApplicantFormInsert) form;
		if(iform.getCitizenship().equals("United States")){
			Vector<String> location = UniversityModel.getLocation();
			
			request.getSession().setAttribute("location", location);
			return mapping.findForward("Citizen");
		}
		else
			return mapping.findForward("NonCitizen");
	}
}
